package com.yyge.config;

import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yyge.common.constans.RedisConstans;
import com.yyge.entity.Contamer;
import com.yyge.service.ContamerService;
import com.yyge.util.DashboardUtil;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

import java.util.Date;

/**
 * @Author gityyge
 * @Description 会员每天统计注册人员个数 做Redis定时任务
 * @Date 2023/7/17 14:29
 * @Version 1.0
 */
@Log4j2
@EnableScheduling
@Configuration
public class ContamerTaskConfig {
    @Autowired
    private ContamerService contamerService;

    @Autowired
    private DashboardUtil dashboardUtil;

    @Autowired
    private RedisTemplate redisTemplate;
    /**
     * 每天0点做任务
     */
    @Scheduled(cron = "0 0 0 * * ? ")
    public void taskCorn(){
        dashboardUtil.refreshCacheDateRePort();
    }


}